#include<bits/stdc++.h>
using namespace std;
char s[1000],s1[1000],s2[1000];
int main()
{
	int i=1;
	while(cin>>s1[i])
	{
		s2[i]=s1[i];
		i++;
	}
	int len=strlen(s2);
	sort(s1+1,s1+i);
	for(i=1;i<=len;i++)
	{
		cout<<s2[i];
		if(s2[i]==s1[len])
		cout<<"(max)";
	}
    return 0;
}
